{include file="../../../application/admin/view/public/head" /}

<div style="padding: 10px;">
    <form class="layui-form layui-form-pane" method="post" action="">
	    <input id="collect_id" name="collect_id" type="hidden" value="{$param.ids}">
        <div class="layui-form-item">
            <label class="layui-form-label">资源名称：</label>
            <div class="layui-input-block  ">
                <input type="text" class="layui-input" value="{$faves.name}" placeholder="" id="collect_name" name="collect_name">
            </div>
        </div>	
        <div class="layui-form-item">
            <label class="layui-form-label">数据操作：</label>
            <div class="layui-input-block">
                <input name="collect_opt" type="radio" value="0" title="新增+更新" {if condition="$faves.opt eq 0"}checked{/if}>
                <input name="collect_opt" type="radio" value="1" title="新增" {if condition="$faves.opt eq 1"}checked{/if}>
                <input name="collect_opt" type="radio" value="2" title="更新" {if condition="$faves.opt eq 2"}checked{/if}>
            </div>
            <div class="layui-form-mid layui-word-aux" style="">提示信息：如果某个资源作为副资源不想新增数据，可以只勾选更新。</div>
        </div>
        <div class="layui-form-item row_filer" >
            <label class="layui-form-label">地址过滤：</label>
            <div class="layui-input-block">
                <input name="collect_filter" type="radio" value="0" title="不过滤" {if condition="$faves.filter eq 0"}checked{/if}>
                <input name="collect_filter" type="radio" value="1" title="新增+更新" {if condition="$faves.filter eq 1"}checked{/if}>
                <input name="collect_filter" type="radio" value="2" title="新增" {if condition="$faves.filter eq 2"}checked{/if}>
                <input name="collect_filter" type="radio" value="3" title="更新" {if condition="$faves.filter eq 3"}checked{/if}>
            </div>
        </div>
        <div class="layui-form-item row_filer">
            <label class="layui-form-label">过滤代码：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" value="{$faves.filter_from}" placeholder="" id="collect_filter_from" name="collect_filter_from">
            </div>
            <div class="layui-form-mid layui-word-aux" style="margin-left:110px; ">过滤提示：多组地址的资源开启白名单后只会入库指定代码的地址。比如 youku,iqiyi</div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="formSubmit" data-child="true">保 存</button>
                <button class="layui-btn layui-btn-warm" type="reset">还 原</button>
            </div>
        </div>
    </form>
</div>
 
{include file="../../../application/admin/view/public/foot" /}

<script type="text/javascript">
layui.use(['element','form','layer'], function() {
        // 操作对象
        var form = layui.form
			,element = layui.element, 
			, layer = layui.layer
			, $ = layui.jquery;
    form.on('submit(formSubmit)', function(data) {
        var that = $(this),
            _form = '';
        _form = $(this).parents('form');
        layer.msg('数据提交中...',{time:15000});
        $.ajax({
            type: "POST",
            data: _form.serialize(),
            success: function(res) {
                if (res.code == 1) {
					layer.msg(res.msg,{icon:6,time:800},function() {
						var index = parent.layer.getFrameIndex(window.name); 
						parent.layer.close(index);
						parent.location.reload(); 
					});    
                }else{
					layer.alert(res.msg ? res.msg : '保存失败，请重试',{icon:5});	
                }
            }
        });
        return false;
    });	

});
</script>
</body>
</html>